<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // typeof可以检测数据的类型
        // 正确的检测数据类型才不会导致程序执行错误
        //数据类型有：string,number,boolean,undefined,symbol,object,function
        const a=Symbol('a');
        const date=new Date();
        const reg=new RegExp();
        const map=new Map()
        const arr=new Array()
        const set=new Set()
       console.log(
        typeof(NaN),//number  
       typeof(1),//number 
        typeof(''),// string
        typeof(true),// boolean 
        typeof({}),// object
        typeof([]),//  object 
        typeof(function(){}),// function
        typeof(()=>{}),// function
        typeof(null),// object
        typeof(undefined), //undefined
        typeof(a), // symbol
        typeof(date),// object
        typeof(reg),// object
        typeof(map), // object
        typeof(arr),// object
        typeof(set),// object

       )
       console.log(typeof Date) // function
       console.log(typeof RegExp) // function
    </script>
</body>
</html>